/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl;

import ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.BusinessDocument;
import ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.BusinessGoal;
import ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.PartnerRole;

import ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.CollaborativeBusinessProcess;
import ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.CollaborativebusinessprocessesPackage;
import ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.ExceptionPoint;
import ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.ExceptionProcess;
import ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.ProcessStates;

import ar.edu.utn.frsf.cidisi.upcolbpip.interactionprotocols.InteractionProtocol;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Collaborative Business Process</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getName <em>Name</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getGoalToFulfill <em>Goal To Fulfill</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getStartEvent <em>Start Event</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getPreCondition <em>Pre Condition</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getPostCondition <em>Post Condition</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getState <em>State</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getScenarios <em>Scenarios</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getProcessRoles <em>Process Roles</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getSubProcesses <em>Sub Processes</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getExceptionConditions <em>Exception Conditions</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getExceptions <em>Exceptions</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getDocuments <em>Documents</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.collaborativebusinessprocesses.impl.CollaborativeBusinessProcessImpl#getInteractionProtocols <em>Interaction Protocols</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CollaborativeBusinessProcessImpl extends EObjectImpl implements CollaborativeBusinessProcess {
	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The cached value of the '{@link #getGoalToFulfill() <em>Goal To Fulfill</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGoalToFulfill()
	 * @generated
	 * @ordered
	 */
	protected BusinessGoal goalToFulfill;

	/**
	 * The default value of the '{@link #getStartEvent() <em>Start Event</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStartEvent()
	 * @generated
	 * @ordered
	 */
	protected static final String START_EVENT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getStartEvent() <em>Start Event</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStartEvent()
	 * @generated
	 * @ordered
	 */
	protected String startEvent = START_EVENT_EDEFAULT;

	/**
	 * The default value of the '{@link #getPreCondition() <em>Pre Condition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPreCondition()
	 * @generated
	 * @ordered
	 */
	protected static final String PRE_CONDITION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPreCondition() <em>Pre Condition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPreCondition()
	 * @generated
	 * @ordered
	 */
	protected String preCondition = PRE_CONDITION_EDEFAULT;

	/**
	 * The default value of the '{@link #getPostCondition() <em>Post Condition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPostCondition()
	 * @generated
	 * @ordered
	 */
	protected static final String POST_CONDITION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPostCondition() <em>Post Condition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPostCondition()
	 * @generated
	 * @ordered
	 */
	protected String postCondition = POST_CONDITION_EDEFAULT;

	/**
	 * The default value of the '{@link #getState() <em>State</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getState()
	 * @generated
	 * @ordered
	 */
	protected static final ProcessStates STATE_EDEFAULT = ProcessStates.READY;

	/**
	 * The cached value of the '{@link #getState() <em>State</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getState()
	 * @generated
	 * @ordered
	 */
	protected ProcessStates state = STATE_EDEFAULT;

	/**
	 * The default value of the '{@link #getScenarios() <em>Scenarios</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getScenarios()
	 * @generated
	 * @ordered
	 */
	protected static final String SCENARIOS_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getScenarios() <em>Scenarios</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getScenarios()
	 * @generated
	 * @ordered
	 */
	protected String scenarios = SCENARIOS_EDEFAULT;

	/**
	 * The cached value of the '{@link #getProcessRoles() <em>Process Roles</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProcessRoles()
	 * @generated
	 * @ordered
	 */
	protected EList<PartnerRole> processRoles;

	/**
	 * The cached value of the '{@link #getSubProcesses() <em>Sub Processes</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSubProcesses()
	 * @generated
	 * @ordered
	 */
	protected EList<CollaborativeBusinessProcess> subProcesses;

	/**
	 * The cached value of the '{@link #getExceptionConditions() <em>Exception Conditions</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExceptionConditions()
	 * @generated
	 * @ordered
	 */
	protected EList<ExceptionPoint> exceptionConditions;

	/**
	 * The cached value of the '{@link #getExceptions() <em>Exceptions</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExceptions()
	 * @generated
	 * @ordered
	 */
	protected EList<ExceptionProcess> exceptions;

	/**
	 * The cached value of the '{@link #getDocuments() <em>Documents</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDocuments()
	 * @generated
	 * @ordered
	 */
	protected EList<BusinessDocument> documents;

	/**
	 * The cached value of the '{@link #getInteractionProtocols() <em>Interaction Protocols</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInteractionProtocols()
	 * @generated
	 * @ordered
	 */
	protected EList<InteractionProtocol> interactionProtocols;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CollaborativeBusinessProcessImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CollaborativebusinessprocessesPackage.Literals.COLLABORATIVE_BUSINESS_PROCESS;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BusinessGoal getGoalToFulfill() {
		if (goalToFulfill != null && goalToFulfill.eIsProxy()) {
			InternalEObject oldGoalToFulfill = (InternalEObject)goalToFulfill;
			goalToFulfill = (BusinessGoal)eResolveProxy(oldGoalToFulfill);
			if (goalToFulfill != oldGoalToFulfill) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__GOAL_TO_FULFILL, oldGoalToFulfill, goalToFulfill));
			}
		}
		return goalToFulfill;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BusinessGoal basicGetGoalToFulfill() {
		return goalToFulfill;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setGoalToFulfill(BusinessGoal newGoalToFulfill) {
		BusinessGoal oldGoalToFulfill = goalToFulfill;
		goalToFulfill = newGoalToFulfill;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__GOAL_TO_FULFILL, oldGoalToFulfill, goalToFulfill));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getStartEvent() {
		return startEvent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStartEvent(String newStartEvent) {
		String oldStartEvent = startEvent;
		startEvent = newStartEvent;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__START_EVENT, oldStartEvent, startEvent));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPreCondition() {
		return preCondition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPreCondition(String newPreCondition) {
		String oldPreCondition = preCondition;
		preCondition = newPreCondition;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PRE_CONDITION, oldPreCondition, preCondition));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPostCondition() {
		return postCondition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPostCondition(String newPostCondition) {
		String oldPostCondition = postCondition;
		postCondition = newPostCondition;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__POST_CONDITION, oldPostCondition, postCondition));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ProcessStates getState() {
		return state;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setState(ProcessStates newState) {
		ProcessStates oldState = state;
		state = newState == null ? STATE_EDEFAULT : newState;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__STATE, oldState, state));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getScenarios() {
		return scenarios;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setScenarios(String newScenarios) {
		String oldScenarios = scenarios;
		scenarios = newScenarios;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SCENARIOS, oldScenarios, scenarios));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<PartnerRole> getProcessRoles() {
		if (processRoles == null) {
			processRoles = new EObjectResolvingEList<PartnerRole>(PartnerRole.class, this, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PROCESS_ROLES);
		}
		return processRoles;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<CollaborativeBusinessProcess> getSubProcesses() {
		if (subProcesses == null) {
			subProcesses = new EObjectResolvingEList<CollaborativeBusinessProcess>(CollaborativeBusinessProcess.class, this, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SUB_PROCESSES);
		}
		return subProcesses;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ExceptionPoint> getExceptionConditions() {
		if (exceptionConditions == null) {
			exceptionConditions = new EObjectContainmentEList<ExceptionPoint>(ExceptionPoint.class, this, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTION_CONDITIONS);
		}
		return exceptionConditions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ExceptionProcess> getExceptions() {
		if (exceptions == null) {
			exceptions = new EObjectContainmentEList<ExceptionProcess>(ExceptionProcess.class, this, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTIONS);
		}
		return exceptions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<BusinessDocument> getDocuments() {
		if (documents == null) {
			documents = new EObjectResolvingEList<BusinessDocument>(BusinessDocument.class, this, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__DOCUMENTS);
		}
		return documents;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<InteractionProtocol> getInteractionProtocols() {
		if (interactionProtocols == null) {
			interactionProtocols = new EObjectContainmentEList<InteractionProtocol>(InteractionProtocol.class, this, CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__INTERACTION_PROTOCOLS);
		}
		return interactionProtocols;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTION_CONDITIONS:
				return ((InternalEList<?>)getExceptionConditions()).basicRemove(otherEnd, msgs);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTIONS:
				return ((InternalEList<?>)getExceptions()).basicRemove(otherEnd, msgs);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__INTERACTION_PROTOCOLS:
				return ((InternalEList<?>)getInteractionProtocols()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__NAME:
				return getName();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__GOAL_TO_FULFILL:
				if (resolve) return getGoalToFulfill();
				return basicGetGoalToFulfill();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__START_EVENT:
				return getStartEvent();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PRE_CONDITION:
				return getPreCondition();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__POST_CONDITION:
				return getPostCondition();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__STATE:
				return getState();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SCENARIOS:
				return getScenarios();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PROCESS_ROLES:
				return getProcessRoles();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SUB_PROCESSES:
				return getSubProcesses();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTION_CONDITIONS:
				return getExceptionConditions();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTIONS:
				return getExceptions();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__DOCUMENTS:
				return getDocuments();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__INTERACTION_PROTOCOLS:
				return getInteractionProtocols();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__NAME:
				setName((String)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__GOAL_TO_FULFILL:
				setGoalToFulfill((BusinessGoal)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__START_EVENT:
				setStartEvent((String)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PRE_CONDITION:
				setPreCondition((String)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__POST_CONDITION:
				setPostCondition((String)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__STATE:
				setState((ProcessStates)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SCENARIOS:
				setScenarios((String)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PROCESS_ROLES:
				getProcessRoles().clear();
				getProcessRoles().addAll((Collection<? extends PartnerRole>)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SUB_PROCESSES:
				getSubProcesses().clear();
				getSubProcesses().addAll((Collection<? extends CollaborativeBusinessProcess>)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTION_CONDITIONS:
				getExceptionConditions().clear();
				getExceptionConditions().addAll((Collection<? extends ExceptionPoint>)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTIONS:
				getExceptions().clear();
				getExceptions().addAll((Collection<? extends ExceptionProcess>)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__DOCUMENTS:
				getDocuments().clear();
				getDocuments().addAll((Collection<? extends BusinessDocument>)newValue);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__INTERACTION_PROTOCOLS:
				getInteractionProtocols().clear();
				getInteractionProtocols().addAll((Collection<? extends InteractionProtocol>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__NAME:
				setName(NAME_EDEFAULT);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__GOAL_TO_FULFILL:
				setGoalToFulfill((BusinessGoal)null);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__START_EVENT:
				setStartEvent(START_EVENT_EDEFAULT);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PRE_CONDITION:
				setPreCondition(PRE_CONDITION_EDEFAULT);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__POST_CONDITION:
				setPostCondition(POST_CONDITION_EDEFAULT);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__STATE:
				setState(STATE_EDEFAULT);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SCENARIOS:
				setScenarios(SCENARIOS_EDEFAULT);
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PROCESS_ROLES:
				getProcessRoles().clear();
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SUB_PROCESSES:
				getSubProcesses().clear();
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTION_CONDITIONS:
				getExceptionConditions().clear();
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTIONS:
				getExceptions().clear();
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__DOCUMENTS:
				getDocuments().clear();
				return;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__INTERACTION_PROTOCOLS:
				getInteractionProtocols().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__GOAL_TO_FULFILL:
				return goalToFulfill != null;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__START_EVENT:
				return START_EVENT_EDEFAULT == null ? startEvent != null : !START_EVENT_EDEFAULT.equals(startEvent);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PRE_CONDITION:
				return PRE_CONDITION_EDEFAULT == null ? preCondition != null : !PRE_CONDITION_EDEFAULT.equals(preCondition);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__POST_CONDITION:
				return POST_CONDITION_EDEFAULT == null ? postCondition != null : !POST_CONDITION_EDEFAULT.equals(postCondition);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__STATE:
				return state != STATE_EDEFAULT;
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SCENARIOS:
				return SCENARIOS_EDEFAULT == null ? scenarios != null : !SCENARIOS_EDEFAULT.equals(scenarios);
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__PROCESS_ROLES:
				return processRoles != null && !processRoles.isEmpty();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__SUB_PROCESSES:
				return subProcesses != null && !subProcesses.isEmpty();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTION_CONDITIONS:
				return exceptionConditions != null && !exceptionConditions.isEmpty();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__EXCEPTIONS:
				return exceptions != null && !exceptions.isEmpty();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__DOCUMENTS:
				return documents != null && !documents.isEmpty();
			case CollaborativebusinessprocessesPackage.COLLABORATIVE_BUSINESS_PROCESS__INTERACTION_PROTOCOLS:
				return interactionProtocols != null && !interactionProtocols.isEmpty();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (name: ");
		result.append(name);
		result.append(", startEvent: ");
		result.append(startEvent);
		result.append(", preCondition: ");
		result.append(preCondition);
		result.append(", postCondition: ");
		result.append(postCondition);
		result.append(", state: ");
		result.append(state);
		result.append(", scenarios: ");
		result.append(scenarios);
		result.append(')');
		return result.toString();
	}

} //CollaborativeBusinessProcessImpl
